<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件

/**
 * 模拟tab产生空格
 * @param int $step
 * @param string $string
 * @param int $size
 * @return string
 */
function tab($step = 1, $string = ' ', $size = 4)
{
    return str_repeat($string, $size * $step);
}

/**
 * 总分
 *  int $cla  班级
 */
function sumScore($cla)
{
    $stuSum=model("User")->where("user_class",$cla)->sum("user_secore");
    return $stuSum;
}
/**
 * 项目报名人名单
 * int $kind 项目的id
 */
function kindUser($kind)
{
    $res=model("User")->where("user_kind",$kind)->order("user_secore DESC")->select();
    return $res;
}
/**
 * 图片路径
 */
function getimg($name)
{
    $path1="__ROOT__/static/uploads/";
    $res=$path1.$name;
    return $res;
}